/*
 * MainApplet.java
 * Copyright (C) 12/30/2005, 18:36 Francisco J. Hernández
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
 * License along with this library; if not, write to the Free
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 * 
 */

package Sindarin;

import javax.swing.JFrame;
import java.security.*;

/**
 *
 * @author  fran
 */
public class MainApplet extends javax.swing.JApplet {
    
    final static String TITULO ="Sindarin";
    
    /** Initializes the applet MainApplet */
    /*public void init() {
        try {
            java.awt.EventQueue.invokeAndWait(new Runnable() {
                public void run() {
                    initComponents();
                    //this.setJMenuBar(mainPanel.menuBar);
                }
            });
        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }*/
    
    public void init() { 
        AccessController.doPrivileged(new PrivilegedAction()
        {
            public Object run() {
                try {
                    initComponents();
                    setJMenuBar(mainPanel.menuBar);
                }
                catch(Exception e) {
                    e.printStackTrace();
                }
                return null;
            }
        });
    }
    
    /** This method is called from within the init() method to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
    private void initComponents() {
        mainPanel = new Sindarin.MainPanel();

        getContentPane().add(mainPanel, java.awt.BorderLayout.CENTER);

    }// </editor-fold>//GEN-END:initComponents
    
    public static void main(String[] args) {
        MainFrame frame = new MainFrame(TITULO);
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.setVisible(true);
    }    
    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private Sindarin.MainPanel mainPanel;
    // End of variables declaration//GEN-END:variables
    
}
